from 读取文件 import *
from Curve_fitting import *
import numpy as np
import matplotlib.pyplot as plt

fig = plt.figure(figsize=(10, 10))
ax = plt.gca()


def Jkx_std(Y, n=6):  # 理论渐开线中, x与y的关系
    t = np.linspace(1.08, 0, 1000)
    r = 50
    w = 1
    x = r * (np.cos(w * t + 1.082) + w * t * np.sin(w * t + 1.082))
    x = x - x[0]
    y = r * (np.sin(w * t + 1.082) - w * t * np.cos(w * t + 1.082))
    y = y - y[0]
    re1 = CF(y, x, n=n)["Factor"]
    return np.polyval(re1, Y)  # 返回一个多项式,关于Y的


filename = "正向仿真数据/9v006.txt"
filename = np.array(loadDatadet(filename))